/**
 *全站右侧悬浮工具条模块
 ***/

define(function(require){
	var $=require("jq");
	var kefuInit=require("qqzxkf.js?v=1");
	var toolbarHtml = 	'<div id="js-site-toolbar" class="g-site-toolbar">'+
							'<div class="site-service site-bar-middle">'+
							'<a class="moblie" href="/chargePay/settleCenter.do" target="_blank"><i></i>充值</a>'+
						    '<a class="hotel" href="/hotel/hotelList.do" target="_blank"><i></i>酒店</a>'+
						    '<a id="js-shopcart" class="cart" href="/gotoCart.do" target="_blank"><i></i>购<br>物<br>车<span class="cart-num">0</span></a>'+
						'</div>'+
						'<div class="site-service site-bar-footer">'+
							'<a id="js-kefu" class="kefu" href="javascript:;"><i></i>客服</a>'+
						    '<a id="js-gotop" class="gotop" href="javascript:;" target="_self"><i></i>顶部</a>'+
						'</div>'+
						'</div>';
	
	$("body").append(toolbarHtml);
	
	//获取相应节点
	var toolbar = $("#js-site-toolbar"),
		kefu    = $("#js-kefu"),
		gotop   = $("#js-gotop"),
		cartNum = $("#js-shopcart").find("span");
	
	toolbar.animate({right:0});
	
	gotop.click(function(){
		
		$("html,body").animate({scrollTop:0});
		
	});
	
	//如果是IE6
	if(/MSIE 6.0/gi.test(window.navigator.userAgent)){
		var w = $(window),
			h = w.height();
		toolbar.height(h);
		
		w.scroll(function(){
			toolbar.css("top",w.scrollTop());
		}).resize(function(){
			toolbar.height(w.height());
		});
	};
	
});